<!DOCTYPE html>
<html lang="en"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:t="http://myfaces.apache.org/tomahawk"
>
    <h:body>
    	<ui:composition template="../Template/template.xhtml">
    		<ui:define name="content">
    			<section id="content">
	    			<h2>Créer un projet</h2>
	    			<p>Création d'un nouveau projet.</p>
	    			<h:form id="newprojectform">
						<fieldset>
							<section>
								<label for="client">Client</label>
								<div>
									<h:selectOneMenu id="client" value="#{CreateProjectBean.projectCusId}" required="true" requiredMessage="Spécifiez un client">
										<f:selectItems value="#{input.customersItems}"/>
									</h:selectOneMenu>
									<h:message for="client" class='error-message'></h:message>
								</div>
							</section>
							<section>
								<label for="name"> Nom du projet </label>
								<div>
									<h:inputText id="name" value="#{CreateProjectBean.projectName}" required="true" requiredMessage="Spécifiez un nom de projet"/>
                                    <h:message for="name" class='error-message'></h:message>
								</div>
							</section>
							<section>
								<label for="comment"> Commentaires </label>
								<div>
									<h:inputTextarea id="comment" value="#{CreateProjectBean.projectComment}" />
								</div>
							</section>
							<section>
								<label for="dob"> Date de début </label>
								<div>
									<t:panelGroup styleClass="date_input">
										<t:inputCalendar id="dob" 
										    type="date"
										    maxlength="10" 
										    value="#{CreateProjectBean.projectDateCreated}"
										    monthYearRowClass="monthYearRowClass" 
										    weekRowClass="weekRowClass" 
										    dayCellClass="dayCellClass" 
										    currentDayCellClass="currentDayCellClass"
										    renderAsPopup="false"
										    alt="Calendar" title="Calendar"
										    required="true" requiredMessage="Spécifiez une date de début"
										    >
                                    	</t:inputCalendar>
                                    	
                                    	<h:message for="dob" class='error-message'></h:message>
									</t:panelGroup>
								</div>
							</section>
							<section>
								<label for="name"> Date de fin </label>
								<div>
									<t:panelGroup styleClass="date_input">
										<t:inputCalendar id="doe" 
										    type="date"
										    maxlength="10" 
										    value="#{CreateProjectBean.projectDateFinished}"
										    monthYearRowClass="monthYearRowClass" 
										    weekRowClass="weekRowClass" 
										    dayCellClass="dayCellClass" 
										    currentDayCellClass="currentDayCellClass"
										    renderAsPopup="false"
										    alt="Calendar" title="Calendar"
                                            required="true" requiredMessage="Spécifiez une date de fin">
                                        </t:inputCalendar>
                                        <h:message for="doe" class='error-message'></h:message>
									</t:panelGroup>
								</div>
							</section>
							<section>
								<label for="time"> Nombre de jours </label>
								<div>
									<h:inputText id="time" value="#{CreateProjectBean.projectTotalTime}" required="true" requiredMessage="Spécifiez un nombre de jour"/>
                                    <h:message for="time" class='error-message'></h:message>
								</div>
							</section>
							<section>
								<label for="cdp"> Chef de projet </label>
								<div>
									<h:selectOneMenu id="cdp" value="#{CreateProjectBean.projectCdpId}">
                                    	<f:selectItems value="#{input.cdpItems}"/>
									</h:selectOneMenu>
								</div>
							</section>
							<section>
								<label for="dev"> Developpeur: </label>
								<div>
									<h:selectManyListbox id="dev" value="#{CreateProjectBean.listDev}">
									   	<f:selectItems value="#{input.usersItemsId}" />
									</h:selectManyListbox>
								</div>
							</section>
							<section>
								<label for="tes"> Testeur: </label>
								<div>
									<h:selectManyListbox id="tes" value="#{CreateProjectBean.listTes}" >
									   	<f:selectItems value="#{input.usersItemsId}" />
									</h:selectManyListbox>
								</div>
							</section>
							<section>
								<label for="rel"> Relecteur: </label>
								<div>
									<h:selectManyListbox id="rel" value="#{CreateProjectBean.listRel}" >
									   	<f:selectItems value="#{input.usersItemsId}" />
									</h:selectManyListbox>
								</div>
							</section>
							<section>
								<div>
									<h:commandButton value="Créer le projet" action="#{CreateProjectBean.updateProject}"/>
								</div>
							</section>
						</fieldset>
					</h:form>
				</section>
    		</ui:define>
    	</ui:composition>    	
    </h:body>
 
</html>